<?php

Route::any('/pushTrace','Api\Auth\RoleController@pushTrace');

$path = 'Api';
Route::prefix('common')->group(function()use($path){

    Route::resource('banner', $path.'\Common\BannerController');//自动添加-ADMIN
    Route::resource('consultType', $path.'\Common\ConsultTypeController');//自动添加-ADMIN
    Route::resource('courseType', $path.'\Common\CourseTypeController');//自动添加-ADMIN
    Route::resource('fileType', $path.'\Common\FileTypeController');//自动添加-ADMIN
    Route::resource('file', $path.'\Common\FileController');//自动添加-ADMIN
    Route::get('comments', $path.'\Common\CommentController@index');//自动添加-ADMIN
    Route::group(['middleware'=>'jwt.api.auth'],function() use($path){
        Route::resource('comment', $path.'\Common\CommentController');//自动添加-ADMIN
        Route::resource('user', $path.'\Common\UserController');//自动添加-ADMIN
    });
});

Route::prefix('express')->group(function()use($path){
    Route::resource('info', $path.'\Express\InfoController');//自动添加-ADMIN
    Route::resource('problem', $path.'\Express\ProblemController');//自动添加-ADMIN
    Route::resource('news', $path.'\Express\NewsController');//自动添加-ADMIN
    Route::resource('course', $path.'\Express\CourseController');//自动添加-ADMIN
    Route::get('weekHotNews', $path.'\Express\NewsController@weekHotNews');
    Route::post('addClick',$path.'\Express\NewsController@addClick');

});

Route::prefix('test')->group(function()use($path){
    Route::resource('test_detail', $path.'\Test\TestDetailController');//自动添加-ADMIN
    Route::resource('test', $path.'\Test\TestController');//自动添加-ADMIN
});



Route::group(['middleware'=>'jwt.api.auth'],function() use($path){
    Route::prefix('user')->group(function()use($path){
        Route::resource('attend', $path.'\Express\AttendController');//自动添加-ADMIN
        Route::resource('collect', $path.'\User\CollectController');//自动添加-ADMIN
        Route::resource('history', $path.'\User\HistoryController');//自动添加-ADMIN
        Route::post('problem', $path.'\Express\ProblemController@store');//自动添加-ADMIN
        Route::get('playVideo/{id}', $path.'\Express\CourseController@playVideo');//自动添加-ADMIN\
        Route::post('collectCourse', $path.'\Express\CourseController@collectCourse');//自动添加-ADMIN\
    });
});








